package com.learner.service.impl;

import com.learner.dao.UserDao;
import com.learner.entity.User;
import com.learner.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Auther: qho
 * @Date: 2018/10/12 00:31
 * @Description:
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User login(User user) {
        return userDao.login(user);
    }

    @Override
    public List<User> find(Map<String, Object> map) {
        return userDao.find(map);
    }

    @Override
    public int delete(Integer id) {
        return userDao.delete(id);
    }

    @Override
    public int add(User user) {
        return userDao.add(user);
    }

    @Override
    public int update(User user) {
        return userDao.update(user);
    }

    @Override
    public User loadById(Integer id) {
        return userDao.loadById(id);
    }

    @Override
    public boolean existUserByDeptId(Integer deptId) {
        return userDao.existUserByDeptId(deptId);
    }
}
